import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget{

  @override
  Widget build(BuildContext context){
    return MaterialApp(
        title: 'Jin Flutter Demo',
        home: Scaffold(
          appBar: AppBar(title: new Text('GridView')),
				/*
				body: new GridView.count(
					padding: const EdgeInsets.all(20.0),
					crossAxisSpacing: 10.0,//每个网格间距
					crossAxisCount: 3,//每行最大显示数
					children: <Widget>[
						const Text('I am Jin'),
						const Text('I love flutter'),
						const Text('I study flutter'),
						const Text('我喜欢吃火锅'),
						const Text('我喜欢看电影'),
						const Text('我喜欢听歌'),
					],
				),*/

        body: GridView(
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 3,
            mainAxisSpacing: 2.0,//网格纵轴间距
            crossAxisSpacing: 2.0,//网格横轴间距
            childAspectRatio:0.7,//宽高比
        ),
        children: <Widget>[
          new Image.network('http://img5.mtime.cn/mt/2018/10/22/104316.77318635_180X260X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/10/10/112514.30587089_180X260X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/13/093605.61422332_180X260X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/07/092515.55805319_180X260X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/21/090246.16772408_135X190X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/17/162028.94879602_135X190X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/19/165350.52237320_135X190X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/16/115256.24365160_180X260X4.jpg',fit: BoxFit.cover),
          new Image.network('http://img5.mtime.cn/mt/2018/11/20/141608.71613590_135X190X4.jpg',fit: BoxFit.cover),
        ],
        )
      ),
    );
  }
}